// 专题详情
const api = require('../../../utils/api') // 引入API
const {
  myRequest
} = require('../../../utils/myRequest') // 请求函数
const WxParse = require('../../../libs/wxParse/wxParse.js') // 富文本解析
Page({
  data: {
    topicDetail: {}
  },
  onLoad: function (options) {
    let id = options.id;
    myRequest({
      url: api.topicDetail,
      data: {
        id: id
      },
      success: res => {
        let topicDetail = res.data.data;
        this.setData({
          topicDetail: topicDetail
        })
        WxParse.wxParse('content', 'html', topicDetail.content, this, 5)
      }
    })
  },
  // 数据处理函数
  processData(list) {
    let obj = list;
    // obj.content = WxParse.wxParse('obj.content', 'html', obj.content, this, 5);
    return obj
  },
  // 图片点击视为false
  wxParseImgLoad() {
    return false
  },
  onReachBottom: function () {

  }
})